{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from tensorflow import keras"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data = keras.datasets.imdb"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "(x_train,y_train),(x_test,y_test) = data.load_data(num_words=20000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def k_hot(seqs, dim=20000):\n",
    "    result = np.zeros((len(seqs),dim))\n",
    "    for i, seq in enumerate(seqs):\n",
    "        result[i, seq] = 1\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x_train = k_hot(x_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(25000, 20000)"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.,  1.,  1., ...,  0.,  0.,  0.])"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_train[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x_test = k_hot(x_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model = keras.Sequential()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.Dense(16,input_dim=20000,activation='relu',kernel_regularizer='l2'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.Dropout(0.5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.Dense(16,activation='relu',kernel_regularizer='l2'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.Dropout(0.5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.add(keras.layers.Dense(1,activation='sigmoid'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_3 (Dense)              (None, 16)                320016    \n",
      "_________________________________________________________________\n",
      "dropout_2 (Dropout)          (None, 16)                0         \n",
      "_________________________________________________________________\n",
      "dense_4 (Dense)              (None, 16)                272       \n",
      "_________________________________________________________________\n",
      "dropout_3 (Dropout)          (None, 16)                0         \n",
      "_________________________________________________________________\n",
      "dense_5 (Dense)              (None, 1)                 17        \n",
      "=================================================================\n",
      "Total params: 320,305\n",
      "Trainable params: 320,305\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.compile(optimizer='adam',loss='binary_crossentropy',metrics=['acc'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 25000 samples, validate on 25000 samples\n",
      "Epoch 1/5\n",
      "25000/25000 [==============================] - 17s 683us/step - loss: 0.7857 - acc: 0.6970 - val_loss: 0.6050 - val_acc: 0.8579\n",
      "Epoch 2/5\n",
      "25000/25000 [==============================] - 11s 422us/step - loss: 0.5999 - acc: 0.8299 - val_loss: 0.5044 - val_acc: 0.8774\n",
      "Epoch 3/5\n",
      "25000/25000 [==============================] - 10s 397us/step - loss: 0.5396 - acc: 0.8545 - val_loss: 0.4784 - val_acc: 0.8798\n",
      "Epoch 4/5\n",
      "25000/25000 [==============================] - 10s 404us/step - loss: 0.5150 - acc: 0.8627 - val_loss: 0.4704 - val_acc: 0.8802\n",
      "Epoch 5/5\n",
      "25000/25000 [==============================] - 10s 401us/step - loss: 0.5014 - acc: 0.8702 - val_loss: 0.4575 - val_acc: 0.8780\n"
     ]
    }
   ],
   "source": [
    "history = model.fit(x_train,y_train,epochs=5,batch_size=216,validation_data=(x_test,y_test))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x2b650cb30b8>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD8CAYAAABw1c+bAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VOW9x/HPj7BEFGRVFFCoolJkTymiIGqx2BZpbblQ\nW3fl0guu1wWXumv1alv3JVetUrVcN1r0uqJ444YSLMqiIkXFALIJCGiEJL/7xzMx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jrkjazN1L3b0f0AUYZGYHN8b71iWJuhq9vczsZ8Aq\nd5+T6veqSSYG/zKga6XHXRLP1XefRq/L3b8q/9PT3Z8FmplZhxTXlYwo2qtOUbaXmTUjhOsj7v5U\nNbtE0mZ11RX175i7rwdmAiOrbIr0d6ymuiJqr0OBY83sU8KQ8JFm9nCVfVLaXpkY/LOBHmbW3cya\nA+OA6VX8w9OMAAABGUlEQVT2mQ6cmPhmfDCwwd1XRF2XmXUyM0v8PIjQ/mtTXFcyomivOkXVXon3\nvB/4wN3/VMNujd5mydQVRZuZWUcza5P4eRdgBPBhld2iaK8664qivdz9Ynfv4u7dCDnxirv/tspu\nKW2vjLsCl7uXmNkk4AXCTJoH3H2BmU1IbL8HeJbwrfhi4GvglDSp61fA78ysBPgGGOeJr/BTycz+\nRpi90MHMioArCF90RdZeSdYVSXsRemQnAPMS48MAlwD7VKotijZLpq4o2mwv4CEzyyEE52Pu/kzU\n/08mWVdUv2Pbacz20pm7IiIxk4lDPSIishMU/CIiMaPgFxGJGQW/iEjMKPhFRGJGwS8iEjMKfhGR\nmFHwi4jEzP8DQyLAsQY29TsAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2b65bc04b00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(history.epoch,history.history.get('acc'),c='r',label=\"acc\")\n",
    "plt.plot(history.epoch,history.history.get('val_acc'),c='b',label='val_acc')\n",
    "plt.legend()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda env:kr]",
   "language": "python",
   "name": "conda-env-kr-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
